<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //         $dataArr = $request->only([ 'name', 'phone', 'password','asset_password']);
        \App\Models\User::create([
            'name'=>'chen',
            'phone'=>'18361771543',
            'password'=>Hash::make('secret'),
            'asset_password'=> Hash::make('secret'),
            'ref_code'=>'666666',
            'reg_ip'=>'127.0.0.1',
        ]);

        for($i=0;$i<5;$i++) {
            \App\Models\User::create([
                'name'=>str_random(10),
                'phone'=>18361111541+$i,
                'password'=>Hash::make('secret'),
                'asset_password'=> Hash::make('secret'),
                'ref_code'=>str_random(6),
                'reg_ip'=>'127.0.0.1',
            ]);
        }
    }
}
